fix(oracle): handle bracketed proxy usernames in go-ora URL#2468
fix(oracle): handle bracketed proxy usernames in go-ora URL#2468Deeven-Seru wants to merge 2 commits intogoogleapis:mainfrom
Conversation
Summary of ChangesHello @DEVELOPER-DEEVEN, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where Oracle proxy usernames with special characters were not correctly handled when constructing Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses issues with special characters in Oracle usernames. The current connection string construction, however, is vulnerable to URL manipulation due to string concatenation, which could allow special characters like ? or # to bypass security controls such as SSL. It is recommended to use the net/url package for robust URL construction to mitigate this vulnerability and improve overall robustness against edge cases.
7642efa to
4233c3a
Compare
|
/gcbrun |
dd43c58 to
ede7fdb
Compare
|
Hi @DEVELOPER-DEEVEN, can you please rebase and clean the PR (seems like it's removing some already merged codes)? Thank you! :) Will take a look once this is ready |
ede7fdb to
687cb13
Compare
|
@Yuan325 yuan PTAL I think it works now |
|
Hi @Deeven-Seru, seems like the rebasing is still removing some existing code (e.g. internal/log/log.go). Please double-check that only your intended updates made it into this PR. Thank you! |
7438b7a to
20051d4
Compare
331dd0a to
41f7349
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request correctly addresses the issue of handling special characters in Oracle proxy usernames by using net/url for proper encoding and includes decodePercentEncodedUserInfo to prevent double-encoding, along with comprehensive new unit tests in oracle_connstring_test.go. However, it introduces critical regressions and security vulnerabilities. The removal of the readOnly parameter and its associated DML handling logic in the RunSQL function breaks INSERT, UPDATE, and DELETE statements, which is also a significant security regression by removing a critical safety feature for executing SQL from untrusted sources. Furthermore, the new connection string construction logic is vulnerable to URL parameter injection and can produce malformed URLs if the base connection string already contains query parameters, and it breaks existing tests in oracle_test.go.
6fe3cd5 to
6dfe250
Compare
|
Correction to prior note : Addressed in latest force-push (6dfe250):
This is now a clean single-commit diff with only Oracle source/test changes. PTAL. |
6dfe250 to
9bee2bf
Compare
There was a problem hiding this comment.
Code Review
This pull request effectively addresses the issue of handling bracketed proxy usernames and other special characters in Oracle connection strings. The introduction of buildGoOraConnString and decodePercentEncodedUserInfo functions centralizes and robustly manages the construction of go-ora DSNs, preventing double-encoding and correctly integrating wallet locations and existing query parameters. The new test file oracle_connstring_test.go provides comprehensive coverage for these changes, significantly improving the reliability of Oracle connections.
|
@Yuan325 ptal |
Yuan325
left a comment
There was a problem hiding this comment.
Hi @Deeven-Seru, left some feedback on this, thank you for your contributions! I'll take another look once it's updated.
c1ed735 to
49cf42f
Compare
|
colsing this as the issue isn fixed via #2469 |
Summary
user[client]are valid in URL formhost:port/service) intact and preserve wallet query handlingFixes #2454